@extends('layouts.base')
@section('title', '广告图片列表管理')
@section('content')
    <!-- ============================================================== -->
    <!-- Container fluid  -->
    <!-- ============================================================== -->
    <div class="container-fluid">
        <!-- ============================================================== -->
        <!-- Bread crumb and right sidebar toggle -->
        <!-- ============================================================== -->
        <div class="row page-titles">
            <div class="col-md-5 align-self-center">
                <h3 class="text-themecolor">广告图片管理--列表</h3>
            </div>
            <div class="col-md-7 align-self-center">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="javascript:void(0)">首页</a></li>
                    <li class="breadcrumb-item">广告图片列表管理</li>
                    <li class="breadcrumb-item active">广告图片列表</li>
                </ol>
            </div>
        </div>
        <!-- ============================================================== -->
        <!-- End Bread crumb and right sidebar toggle -->
        <!-- ============================================================== -->

        <!-- ============================================================== -->
        <!-- Start Page Content --> 
        <!-- ============================================================== -->
        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div class="card-body">
                        <h4 class="card-title">广告图片列表</h4>
                        <h6 class="card-subtitle"></h6>
                        <div class="card-body">
                            @can('admin.adverimage.created')
                            <a class="btn btn-success float-right" href="{{ route('admin.adverimage.created') }}"><i class="fas fa-plus"></i> 添加</a>
                            @endcan
                        </div>
                        <div class="table-responsive">
                            <table id="demo-foo-addrow" class="table table-bordered m-t-30 table-hover contact-list" data-paging="true" data-paging-size="7">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>广告图片名称</th>
                                    <th>广告图片</th>
                                    <th>添加时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                    @foreach($result as $item)
                                        <tr>
                                            <td> {{ $item->id}}</td>
                                            <td>{{ $item->adver_name}}</td>
                                            <td><img src="{{$item->adver_image}}" alt="" style="width:120px;height:50px;"></td>
                                            <td>{{ $item->created_at}}</td>
                                            <td>{!! $item->actionButton !!}</td>
                                        </tr>
                                    @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12 col-md-4"><div class="dataTables_info" id="example_info" role="status" aria-live="polite"></div></div>
                        <div class="col-sm-12 col-md-8">
                            <div class="dataTables_paginate paging_simple_numbers" id="example_paginate">
                            {{$result->appends([
                                'adverName' => request()->adverName
                            ])->links('layouts.pagination')}}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

@stop

@section('admin-js')
<script type="text/javascript">

function del(){

}
  $(".isDel").click(function(){
      urls = $(this).attr("actionstr");

      swal({
          title: "您确定要删除吗?",
          icon: "warning",
          buttons: ['取消', '确定'],
          dangerMode: true,
      })
          .then((willDelete) => {
              if (willDelete) {
                  $('#deleteForm').attr('action',urls);
                  $('#deleteForm').submit();
              } else {

              }
          });
  })
</script>

@stop

